package com.zmx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmx.entity.SysMenu;
import org.apache.ibatis.annotations.Param;
import org.springframework.core.annotation.Order;

import java.awt.*;
import java.util.List;

/**
 * 2020/10/20
 * 9:54
 * zmx
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {
    List<SysMenu> findAllMenu(@Param("userId") long userId,@Param("parentId") long parentId,@Param("type") int type);
    /*分页菜单*/
    List<SysMenu> findMenuByPage(@Param("limit")Integer limit, @Param("offset")Integer offset,
                                 @Param("search") String search, @Param("order")String order);
    long findMenuTotal(@Param("search")String search);
    /*用户权限*/
    List<String> findPermsByUid(@Param("userId") long userId);
    List<SysMenu> findAllTree();
    /*添加新菜单*/
    int saveMenu(SysMenu sysMenu);
    int fakeDeleteByIds(@Param("ids") List<Long> ids);
    // 根据id查找
    SysMenu findMenuById(@Param("id")long id);
    int updateMenu(SysMenu sysMenu);
}
